package univer.oko;

import univer.oko.utilities.CDUtilities;

import javax.swing.*;
import java.util.Date;

/**
 * @author Eduard Dudar
 *         Date: 14.01.2006
 */
public class Main extends JFrame {
    private static final long serialVersionUID = -8279324119902920800L;
    private static MainThread thread;

    public static void main(String[] args) {
        Try2SetSystemLookAndFeel();
        CDThreadGroup tGroup = new CDThreadGroup("Main CD Thread Group", "log/oko");
        Main.thread = new MainThread(tGroup);
        Main.thread.start();
    }

    /**
     * implemented by edudar only for jfcunit
     */
    public static JFrame getAccessWindow() {
        return Main.thread.getAccessWindow();
    }
    static  void  Try2SetSystemLookAndFeel()
     {
         try
         {
           //   UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
         }
         catch(Exception x)
         {

         }
     }
}

class MainThread extends Thread {
    protected AccessFrame accessWindow;

    public MainThread(CDThreadGroup group) {
        super(group, "Main Thread");
    }

    public void run() {
        System.setProperty("java.security.policy", "client.policy");
        CDUtilities.loadOptions();
        this.accessWindow = new AccessFrame();
        this.accessWindow.showView();

    }
    
    public JFrame getAccessWindow() {
        return this.accessWindow;
    }


}